1. Field of the Invention
This invention relates generally to the field of computer graphics and, more particularly, to a high performance graphics system which implements super-sampling and/or video rate filtering for interlaced video frames.
2. Description of the Related Art
A computer system typically relies upon its graphics system for producing visual output on the computer screen or display device. Early graphics systems were only responsible for taking what the processor produced as output and displaying that output on the screen. In essence, they acted as simple translators or interfaces. Modern graphics systems, however, incorporate graphics processors with a great deal of processing power. They now act more like coprocessors rather than simple translators. This change is due to the recent increase in both the complexity and amount of data being sent to the display device. For example, modern computer displays have many more pixels, greater color depth, and are able to display images that are more complex with higher refresh rates than earlier models. Similarly, the images displayed are now more complex and may involve advanced techniques such as anti-aliasing and texture mapping.
As a result, without considerable processing power in the graphics system, the CPU would spend a great deal of time performing graphics calculations. This could rob the computer system of the processing power needed for performing other tasks associated with program execution and thereby dramatically reduce overall system performance. However, with a powerful graphics system, the CPU may send a request to the graphics system stating: xe2x80x9cdraw a box at these coordinatesxe2x80x9d. The graphics system then draws the box, freeing the processor to perform other tasks.
Since graphics systems typically perform only a limited set of functions, they may be customized and therefore far more efficient at graphics operations than the computer""s general-purpose central processor. Graphics system processors are specialized for computing graphical transformations, so they tend to achieve better results than the general-purpose CPU used by the computer system. In addition, they free up the computer""s CPU to execute other commands while the graphics system is handling graphics computations. The popularity of graphical applications, and especially multimedia applications, has made high performance graphics systems a common feature of computer systems. Most computer manufacturers now bundle a high performance graphics subsystem with their systems.
Early graphics systems were limited to performing two-dimensional (2D) graphics. Their functionality has since increased to support three-dimensional (3D) wire-frame graphics, 3D solids, and now includes support for three-dimensional (3D) graphics with textures and special effects such as advanced shading, fogging, alpha-blending, and specular highlighting.
While the number of pixels and drawing speed are important factors in determining graphics system performance, another factor of equal import is the quality of the image. Various methods are used to improve the quality of images, such as anti-aliasing, alpha blending, and fogging. While various techniques may be used to improve the appearance of computer graphics images, they also have certain limitations. In particular, they may introduce their own image aberrations or artifacts, and are typically limited by the density of pixels displayed on the display device.
As a result, a graphics system is desired which is capable of utilizing increased performance levels to increase not only the number of pixels rendered, but also the quality of the image rendered. In addition, a graphics system is desired which is capable of utilizing increases in processing power to improve graphics effects.
Prior art graphics systems have generally fallen short of these goals. Prior art graphics systems use a conventional frame buffer for refreshing pixel/video data on the display. The frame buffer stores rows and columns of pixels that exactly correspond to respective row and column locations on the display. Prior art graphics systems render 2D and/or 3D images or objects into the frame buffer in pixel form, and then read the pixels from the frame buffer to refresh the display. To reduce visual artifacts that may be created by refreshing the screen at the same time as the frame buffer is being updated, most graphics systems"" frame buffers are double-buffered.
To obtain images that are more realistic, some prior art graphics systems have implemented super-sampling by generating more than one sample per pixel. By calculating more samples than pixels (i.e., super-sampling), a more detailed image is calculated than can be displayed on the display device. For example, a graphics system may calculate a plurality of samples for each pixel to be output to the display device. After the samples are calculated, they are then combined, convolved, or filtered to form the pixels that are stored in the frame buffer and then conveyed to the display device. Using pixels formed in this manner may create a more realistic final image because overly abrupt changes in the image may be smoothed by the filtering process.
As used herein, the term xe2x80x9csamplexe2x80x9d refers to calculated information that indicates the color of the sample and possibly other information, such as depth (z), transparency, etc., of a particular point on an object or image. For example, a sample may comprise the following component values: a red value, a green value, a blue value, a z value, and an alpha value (e.g., representing the transparency of the sample).
To generate pixel values from sample data in real time as needed for a video data stream or an interlaced video data stream, improved methods are desired for managing the sample data used to generate pixel values.
The problems set forth above may at least in part be solved by a data management system and method for real time calculation of pixel values from sample data to provide anti-aliasing for interlaced video data streams. Interlaced video formats are generated by first processing virtual pixel locations in even numbered scanlines of pixels to generate an even field, and then processing virtual pixel locations in odd numbered scanlines of pixels to generate an odd field.
The elements of such a data management system may include a sample buffer that may be configured to store sample data in rows of sample bins. Sample data for one or more sample positions may be stored in each sample bin and the rows of sample bins define a region in sample space. Sample data includes one or more of sample location, color values, transparency value, and depth. A bin scanline cache may be configured to store P rows of sample bins copied from P sequential rows of the sample buffer from a specified portion of sample space. N sequential rows of the P rows may be approximately vertically centered on a selected virtual pixel location in sample space. N and P are positive integers, and P may be greater than or equal to N. A sample cache may be configured to store an Nxc3x97N sample bin array of sample bins copied from N sequential columns of the N sequential rows of the bin scanline cache. The sample bins contained in the Nxc3x97N sample bin array may be approximately centered on the selected virtual pixel location in sample space.
A sample processor may be configured to determine pixel values for the selected virtual pixel location by processing one or more sample values stored in the sample cache. A sample controller may be configured to select a sequence of virtual pixel locations in sample space that corresponds to a sequence of pixels in an interlaced video data stream. To generate a video data stream for an interlaced frame, the pixel values for a sequence of virtual pixel locations in each of the even numbered scanlines may be calculated and then the pixel values for a sequence of pixel locations in each of the odd numbered scanlines may be calculated.
A sample controller may include a scanline address unit. The sample controller may be configured to generate pixel data for both interlaced and non-interlaced video frames by a) receiving an input signal specifying either interlaced or non-interlaced video frames, b) routing the input signal to the scanline address unit, and c) the scanline address unit adding either 2xcex94Y or xcex94Y, for interlaced or non-interlaced video frames respectively, to the scanline address at the end of a scanline to generate the next scanline of virtual pixel locations, where xcex94Y is the vertical spacing between consecutive scanlines of virtual pixel locations.
Virtual pixel positions form an array with horizontal displacement xcex94X between successive virtual pixel positions in a row and vertical displacement xcex94Y between successive rows. The first virtual pixel position in the first row is controlled by a start position (Xstart,Ystart). The horizontal displacement xcex94X, vertical displacement xcex94Y and the start coordinates Xstart and Ystart are programmable parameters. The scanning sequence may be controlled in three layers. The innermost layer of control may sequence pixel positions by starting at Xstart and incrementing by xcex94X. The next layer of control may sequence Y by xcex94Y at the end of each row of pixel positions (or by 2xcex94Y in the interlaced mode). In the interlaced mode, the outer layer of control may cycle between even and odd fields (starting Y in pixel line 0 at Ystart for an even field and starting Y in pixel line 1 at Ystart+xcex94Y for an odd field).
The sample controller may execute, for each pixel in a sequence of pixels for an interlaced video data stream, a set of operations that includes one or more of: a) selecting first an even field composed of all even numbered scanlines, and then an odd field composed of all odd numbered scanlines when generating an interlaced video frame, b) reading sample data from a sequentially selected row of sample bins from the sample buffer and storing the sample data in a corresponding row of sample bins in the bin scanline cache, c) reading sample data from a sequentially selected column of N sample bins from the bin scanline cache and storing said sample data in a corresponding column of N sample bins in the sample cache, so that for each pixel in the sequence, the Nxc3x97N sample bin array is an array of sample bins that are approximately centered on the sample bin that contains the virtual pixel location, d) initiating the determination of pixel values by the sample processor for each virtual pixel location corresponding to a pixel by processing the sample data stored in the sample bins of the Nxc3x97N sample bin array, e) outputting pixel data for inclusion in the interlaced video data stream, and f) selecting the next virtual pixel location in the interlaced video frame. In some embodiments, the interlaced video data stream may be a real time interlaced video stream.
The system may also include a filter weights cache for storing filter coefficients that may be used to compute a weighted average of the sample data in the sample bins of the Nxc3x97N sample bin array stored in the sample cache.
The system may also include a host computer configured to provide a stream of polygons representative of a collection of objects, a graphics processor (e.g. a rendering engine) for rendering the polygons into sample data and storing the sample data in the sample buffer, a video output unit configured to receive pixel values, convert the pixel values into a video signal, and output the video signal to a display.
In some embodiments, the method includes determining pixel values by calculating a weighted sum of the sample values for one or more sample locations from each of the sample bins in the Nxc3x97N sample bin array using weight coefficients corresponding to a specified filter function with a specified filter extent. In these embodiments, the weight coefficients for each sample location may be determined by using a lookup table of values, stored in a filter weights cache corresponding to a specified filter function. The specified filter function may be programmable, and may be selected from a set of filter functions including, but not limited to, box filters, tent filters, square filters, and radial filters.